package org.restorator.dao.implement.engin;

import org.restorator.dao.jdbc.RowMapper;
import org.restorator.entity.AnonymClientOrder;
import org.restorator.entity.Order;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @author Snisar Bogdan.
 */
public class OrderRowMapper implements RowMapper<Order> {

    @Override
    public Order mapRow(ResultSet rs, int rowCount) throws SQLException {
        Order order = new AnonymClientOrder();
//        rs.
        order.setOrderId(rs.getInt(1));
        order.setOpenDate(rs.getDate(2).getTime());
        order.setCloseDate(rs.getDate(2).getTime());
        return order;
    }
}
